class EditEmitPlugin {
  constructor() {

  }

  apply(compiler) {
    compiler.hooks.compilation.tap('EditEmitPlugin', (compilation) => {
      compilation.hooks.processAssets.tap({ name: 'EditEmitPlugin', stage: compilation.PROCESS_ASSETS_STAGE_ADDITIONAL }, (assets) => {
        for (let pathname in assets) {
          if (/main/.test(pathname)) {
            assets[pathname]._source._children.push('console.log(121212)')
            console.log(111, pathname, assets[pathname])
          }

        }
      })
    })
  }
}

module.exports = EditEmitPlugin
